<template>
  <div class="mittA">
    <h4>我是组件A(接收方)</h4>
    <p>{{ str }}</p>
  </div>
</template>

<script setup lang="ts">
import Bus from "@/utils/EventBus";
import { ref } from "vue";

const str = ref("");

Bus.on("message", (Val: any) => {
  str.value = Val;
});
</script>

<style lang="scss" scoped>
.mittA {
  border: 2px solid skyblue;
  width: 200px;
  height: 200px;
  text-align: center;
  margin-bottom: 20px;
}
</style>
